--------------------------------------------------------------------------------
Replication Data for Atsusaka and Stevenson (2021) "A Bias-Corrected Estimator for the Crosswise Model with Inattentive Respondents"
--------------------------------------------------------------------------------

Contents:
   - Citation and Use
   - R Code Summary
   - Data Summary

For further questions, please contact the corresponding author (Yuki Atsusaka) at: 
   atsusaka@rice.edu
   yukia887@gmail.com

--------------------------------------------------------------------------------
Citation and Use of this Replication Data
--------------------------------------------------------------------------------

When citing this replication data (either its entirety, code, or datasets), please use the following formats:

For LaTeX Users:

@data{PUT_DATE	,
author = {Atsusaka, Yuki and Randolph T. Stevenson},
publisher = {Harvard Dataverse},
title = {{Replication Data for: A Bias-Corrected Estimator for the Crosswise Model with Inattentive Respondents}},
year = {2021},
version = {DRAFT VERSION},
doi = {https://doi.org/10.7910/DVN/AHWMIL},
url = {PUT_URL}
}

For non-LaTex Users:

Atsusaka, Yuki and Randolph T. Stevenson, 2021, "A Bias-Corrected Estimator for the Crosswise Model with Inattentive Respondents", DOI_HERE, Harvard Dataverse, DRAFT VERSION 

--------------------------------------------------------------------------------
R Code Summary
--------------------------------------------------------------------------------

This folder contains nine .R files that are necessary to replicate all the figures and tables in the main text and the Online Appendix.
Each file name indicates what result the code therein replicates:
   
   Figure1.R
   Figure2_FigureB1_FigureB2.R --- long run time alarm (approx. 47 minutes)
   Figure3.R
   Figure4_FigureC1.R

   FigureA1.R   
   FigureC2.R
   FigureC3.R
   FigureC4.R
   FigureC5.R
   FigureC6.R   
   FigureC7.R                  --- long run time alarm (approx. 2.5 hours)
   FigureC7_function.R

   Master.R                    --- A master script to run all files 

Note that some files contain code for multiple figures, whereas some files only contain help functions.
On the run time: almost all R files can be implemented within at most 1 minutes. One exception is Figure2_FigureB1_FigureB2.R and FitureC7.
To run "Figure2_FigureB1_FigureB2.R", it takes about 47 minutes. To run, "FigureC7.R", it takes about 2.5 HOURS.
So please take an extra care when running these files.

* Computational platform and configuration
The run time of each file is based on: 

  - Windows 10 Pro with
  - Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz 2.59 GHz 
  - 8.00 GB RAM

* Versions of R and R packages used in the above code

  - R version 4.1.0 (2021-05-18) -- "Camp Pontanezen"
  - tidyverse (1.3.1)
  - sclaes (1.1.1)
  - viridis (0.6.1)
  - devtools (2.4.1)
  - cWise (beta version available via devtools::install_github("YukiAtsusaka/cWise"))
  - stats (base package)

--------------------------------------------------------------------------------
Data Summary
--------------------------------------------------------------------------------

This folder contains one dataset used in the main text and one dataset analyzed in the Online Appendix.

   Existing_Works.csv


"Existing_Works.csv" contains information about all published or pre-print studies that mention the crosswise model that the authors were able to find between 2008 and 2021 (as of January 2021). This csv file is used to create Figures 4 and C1 (sensitivity analysis).

Full title: Existing Works on the Crosswise Model
Unit: question with the crosswise model 
Number of observations: 148
Number of variables:    16
Desciprtion of variables:

  Title:                    article/manuscript title
  Year:                     publication year
  Author:                   author name(s)
  Journal:                  journal name
  Country:                  country in which the crosswise model was used
  Subject:                  type of survey respondents
  Format:                   type of survey format (e.g., online, in-person, etc)
  Application:              substantive application domain
  SensitiveStatement:       sensitive statement of interest
  CrosswiseEstimate:        point estimate via the crosswise model (naive estimate)
  NonsensitiveStatement:    non-sensitive statement used in the crosswise model
  NonsensitiveProbability:  known-probability for the non-sensitive statement
  Nc:                       number of respondents for the crosswise model
  DirectEstimate:           direct questioning estimate (if available)
  Nd:                       number of respondents for direct questioning (if available)
  OnlyMention:              binary variable denoting whether the crosswise model is only mentioned in the study


Data collection procedure:
This dataset is a hand-coded data on existing studies that use the crosswise model from 2008 to 2021 (as of January 2021).
To hand-code data, we used Google Scholar and searched with "the crosswise model" for each year in the study period.

--------------------------------------------------------------------------------
End of This README.txt File
--------------------------------------------------------------------------------